<h2>Resultado de Búsqueda</h2>
<?php $par = $sf_params->getAll(); ?>
<div class="paginador">
<span class="ordenacion">
Ordenar por:
<?php echo link_to('Nuevos','main/buscar?search='.$par['search'].'&page='.$articulosList->getPage().'&orden=3') ?>
 - 
<?php echo link_to('Precio Bajo','main/buscar?search='.$par['search'].'&page='.$articulosList->getPage().'&orden=1') ?>
 - 
<?php echo link_to('Precio Alto','main/buscar?search='.$par['search'].'&page='.$articulosList->getPage().'&orden=2') ?>
</span>
<?php if ($articulosList->haveToPaginate()): ?>
  <?php if($articulosList->getPage() > 4): ?>
  <?php echo link_to($articulosList->getFirstPage(), 'main/buscar?search='.$par['search'].'&page='.$articulosList->getFirstPage()) ?>
  ...
  <?php endif; ?>
  <?php $links = $articulosList->getLinks(); foreach ($links as $page): ?>
    <?php echo ($page == $articulosList->getPage()) ? $page : link_to($page, 'main/buscar?search='.$par['search'].'&page='.$page) ?>
    <?php if ($page != $articulosList->getCurrentMaxLink()): ?> - <?php endif ?>
  <?php endforeach ?>
  <?php if ( ( $articulosList->getCurrentMaxLink() > 4 ) && ( $articulosList->getPage() < ( $articulosList->getCurrentMaxLink()))): ?>
    ...
    <?php echo link_to($articulosList->getLastPage(), 'main/buscar?search='.$par['search'].'&page='.$articulosList->getLastPage()) ?>
  <?php endif; ?>
  <?php echo link_to(image_tag('flecha_izq.png'), 'main/buscar?search='.$par['search'].'&page='.$articulosList->getPreviousPage()) ?>
  <?php echo link_to(image_tag('flecha_der.png'), 'main/buscar?search='.$par['search'].'&page='.$articulosList->getNextPage()) ?>
  
<?php endif ?>
&nbsp;&nbsp;&nbsp;&nbsp;
<?php echo $articulosList->getNbResults() ?> Artículos.

</div>
<?php foreach($articulosList->getResults() as $articulo): ?>
  <div class="articulo">
    <a href=<?php echo url_for('main/show?id='.$articulo->getId())?>><img src=<?php echo url_for('main/test?id='.$articulo->getId());?>></a><br/>
    <span class="descripcion"><?php echo $articulo->getName() ?></span><br/>
    <span class="precio"><?php echo $articulo->getPricesell() ?></span>
  </div>
<?php endforeach; ?>